package Lottery;
import java.util.HashSet;
import java.util.Set;

class User {
    String id;
    String username;
    String password;
    double accountBalance;
    String phoneNumber;
    Set<Integer> ticketNumbers;

    public User(String id, String username, String password, double accountBalance, String phoneNumber) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.accountBalance = accountBalance;
        this.phoneNumber = phoneNumber;
    }

    public void buyTicket(Set<Integer> numbers) {
        ticketNumbers = numbers;
    }

    public int checkTicket(Set<Integer> drawNumbers) {
        Set<Integer> matches = new HashSet<>(ticketNumbers);
        matches.retainAll(drawNumbers);
        return matches.size();
    }

    public Set<Integer> getTicketNumbers() {
        return ticketNumbers;
    }
}